package com.jy.rhin.infra.repo.node.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.jy.rhin.infra.repo.node.po.NodeAuthenticationPermissionRelationPo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 *
 */
@Mapper
@Repository
public interface NodeAuthenticationPermissionRelationMapper extends BaseMapper<NodeAuthenticationPermissionRelationPo> {
	
	 @Select("select count(*) from t_node_authentication_permission_relation where node_id in (select id from t_node_authentication where public_key = #{pk}) and permission_id in (select id from t_node_authentication_permission where permission_code = #{code})")
	 int getByPkAndCode(@Param("pk") String pk, @Param("code") String code);
	

    
}
